package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysEmailRecord;
import com.ruoyi.system.mapper.SysEmailRecordMapper;
import com.ruoyi.system.service.ISysEmailRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 电子邮件发送记录Service业务层处理
 *
 * @author athena
 * @date 2024-05-16
 */
@Service
public class SysEmailRecordServiceImpl implements ISysEmailRecordService
{
    @Autowired
    private SysEmailRecordMapper sysEmailRecordMapper;

    /**
     * 查询电子邮件发送记录
     *
     * @param id 电子邮件发送记录主键
     * @return 电子邮件发送记录
     */
    @Override
    public SysEmailRecord selectSysEmailRecordById(Long id)
    {
        return sysEmailRecordMapper.selectSysEmailRecordById(id);
    }

    /**
     * 查询电子邮件发送记录列表
     *
     * @param sysEmailRecord 电子邮件发送记录
     * @return 电子邮件发送记录
     */
    @Override
    public List<SysEmailRecord> selectSysEmailRecordList(SysEmailRecord sysEmailRecord)
    {
        return sysEmailRecordMapper.selectSysEmailRecordList(sysEmailRecord);
    }

    /**
     * 新增电子邮件发送记录
     *
     * @param sysEmailRecord 电子邮件发送记录
     * @return 结果
     */
    @Override
    public int insertSysEmailRecord(SysEmailRecord sysEmailRecord)
    {
        sysEmailRecord.setCreateTime(DateUtils.getNowDate());
        return sysEmailRecordMapper.insertSysEmailRecord(sysEmailRecord);
    }

    /**
     * 修改电子邮件发送记录
     *
     * @param sysEmailRecord 电子邮件发送记录
     * @return 结果
     */
    @Override
    public int updateSysEmailRecord(SysEmailRecord sysEmailRecord)
    {
        sysEmailRecord.setUpdateTime(DateUtils.getNowDate());
        return sysEmailRecordMapper.updateSysEmailRecord(sysEmailRecord);
    }

    /**
     * 批量删除电子邮件发送记录
     *
     * @param ids 需要删除的电子邮件发送记录主键
     * @return 结果
     */
    @Override
    public int deleteSysEmailRecordByIds(Long[] ids)
    {
        return sysEmailRecordMapper.deleteSysEmailRecordByIds(ids);
    }

    /**
     * 删除电子邮件发送记录信息
     *
     * @param id 电子邮件发送记录主键
     * @return 结果
     */
    @Override
    public int deleteSysEmailRecordById(Long id)
    {
        return sysEmailRecordMapper.deleteSysEmailRecordById(id);
    }
}
